\(\int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx\) [261]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 56 \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {e x}{a}+\frac {f x^2}{2 a}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {i f \sinh (c+d x)}{a d^2} \]

[Out]

e*x/a+1/2*f*x^2/a-I*(f*x+e)*cosh(d*x+c)/a/d+I*f*sinh(d*x+c)/a/d^2

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {5682, 3377, 2717} \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {i f \sinh (c+d x)}{a d^2}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {e x}{a}+\frac {f x^2}{2 a} \]

[In]

Int[((e + f*x)*Cosh[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

(e*x)/a + (f*x^2)/(2*a) - (I*(e + f*x)*Cosh[c + d*x])/(a*d) + (I*f*Sinh[c + d*x])/(a*d^2)

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 5682

Int[(Cosh[(c_.) + (d_.)*(x_)]^(n_)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sinh[(c_.) + (d_.)*(x_)]), x_Symb
ol] :> Dist[1/a, Int[(e + f*x)^m*Cosh[c + d*x]^(n - 2), x], x] + Dist[1/b, Int[(e + f*x)^m*Cosh[c + d*x]^(n -
2)*Sinh[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 1] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \int (e+f x) \sinh (c+d x) \, dx}{a}+\frac {\int (e+f x) \, dx}{a} \\ & = \frac {e x}{a}+\frac {f x^2}{2 a}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {(i f) \int \cosh (c+d x) \, dx}{a d} \\ & = \frac {e x}{a}+\frac {f x^2}{2 a}-\frac {i (e+f x) \cosh (c+d x)}{a d}+\frac {i f \sinh (c+d x)}{a d^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.25 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.02 \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {(c+d x) (-2 d e+c f-d f x)+2 i d (e+f x) \cosh (c+d x)-2 i f \sinh (c+d x)}{2 a d^2} \]

[In]

Integrate[((e + f*x)*Cosh[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

-1/2*((c + d*x)*(-2*d*e + c*f - d*f*x) + (2*I)*d*(e + f*x)*Cosh[c + d*x] - (2*I)*f*Sinh[c + d*x])/(a*d^2)

Maple [A] (verified)

Time = 3.08 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.25

method result size
risch \(\frac {f \,x^{2}}{2 a}+\frac {e x}{a}-\frac {i \left (d f x +d e -f \right ) {\mathrm e}^{d x +c}}{2 a \,d^{2}}-\frac {i \left (d f x +d e +f \right ) {\mathrm e}^{-d x -c}}{2 a \,d^{2}}\) \(70\)
derivativedivides \(-\frac {-i f c \cosh \left (d x +c \right )+i d e \cosh \left (d x +c \right )+i f \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) \(84\)
default \(-\frac {-i f c \cosh \left (d x +c \right )+i d e \cosh \left (d x +c \right )+i f \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )+f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) \(84\)

[In]

int((f*x+e)*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/2*f*x^2/a+e*x/a-1/2*I*(d*f*x+d*e-f)/a/d^2*exp(d*x+c)-1/2*I*(d*f*x+d*e+f)/a/d^2*exp(-d*x-c)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.36 \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {{\left (-i \, d f x - i \, d e + {\left (-i \, d f x - i \, d e + i \, f\right )} e^{\left (2 \, d x + 2 \, c\right )} + {\left (d^{2} f x^{2} + 2 \, d^{2} e x\right )} e^{\left (d x + c\right )} - i \, f\right )} e^{\left (-d x - c\right )}}{2 \, a d^{2}} \]

[In]

integrate((f*x+e)*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(-I*d*f*x - I*d*e + (-I*d*f*x - I*d*e + I*f)*e^(2*d*x + 2*c) + (d^2*f*x^2 + 2*d^2*e*x)*e^(d*x + c) - I*f)*
e^(-d*x - c)/(a*d^2)

Sympy [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 167, normalized size of antiderivative = 2.98 \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\begin {cases} \frac {\left (\left (- 2 i a d^{3} e - 2 i a d^{3} f x - 2 i a d^{2} f\right ) e^{- d x} + \left (- 2 i a d^{3} e e^{2 c} - 2 i a d^{3} f x e^{2 c} + 2 i a d^{2} f e^{2 c}\right ) e^{d x}\right ) e^{- c}}{4 a^{2} d^{4}} & \text {for}\: a^{2} d^{4} e^{c} \neq 0 \\\frac {x^{2} \left (- i f e^{2 c} + i f\right ) e^{- c}}{4 a} + \frac {x \left (- i e e^{2 c} + i e\right ) e^{- c}}{2 a} & \text {otherwise} \end {cases} + \frac {e x}{a} + \frac {f x^{2}}{2 a} \]

[In]

integrate((f*x+e)*cosh(d*x+c)**2/(a+I*a*sinh(d*x+c)),x)

[Out]

Piecewise((((-2*I*a*d**3*e - 2*I*a*d**3*f*x - 2*I*a*d**2*f)*exp(-d*x) + (-2*I*a*d**3*e*exp(2*c) - 2*I*a*d**3*f
*x*exp(2*c) + 2*I*a*d**2*f*exp(2*c))*exp(d*x))*exp(-c)/(4*a**2*d**4), Ne(a**2*d**4*exp(c), 0)), (x**2*(-I*f*ex
p(2*c) + I*f)*exp(-c)/(4*a) + x*(-I*e*exp(2*c) + I*e)*exp(-c)/(2*a), True)) + e*x/a + f*x**2/(2*a)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 188 vs. \(2 (53) = 106\).

Time = 0.26 (sec) , antiderivative size = 188, normalized size of antiderivative = 3.36 \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {1}{2} \, f {\left (\frac {2 \, x e^{\left (d x + c\right )}}{a d e^{\left (d x + c\right )} - i \, a d} - \frac {i \, d^{2} x^{2} e^{c} + i \, d x e^{c} - {\left (-i \, d x e^{\left (3 \, c\right )} + i \, e^{\left (3 \, c\right )}\right )} e^{\left (2 \, d x\right )} - {\left (d^{2} x^{2} e^{\left (2 \, c\right )} - 3 \, d x e^{\left (2 \, c\right )} + e^{\left (2 \, c\right )}\right )} e^{\left (d x\right )} + {\left (d x + 1\right )} e^{\left (-d x\right )} + i \, e^{c}}{a d^{2} e^{\left (d x + 2 \, c\right )} - i \, a d^{2} e^{c}}\right )} + \frac {1}{2} \, e {\left (\frac {2 \, {\left (d x + c\right )}}{a d} - \frac {i \, e^{\left (d x + c\right )}}{a d} - \frac {i \, e^{\left (-d x - c\right )}}{a d}\right )} \]

[In]

integrate((f*x+e)*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="maxima")

[Out]

1/2*f*(2*x*e^(d*x + c)/(a*d*e^(d*x + c) - I*a*d) - (I*d^2*x^2*e^c + I*d*x*e^c - (-I*d*x*e^(3*c) + I*e^(3*c))*e
^(2*d*x) - (d^2*x^2*e^(2*c) - 3*d*x*e^(2*c) + e^(2*c))*e^(d*x) + (d*x + 1)*e^(-d*x) + I*e^c)/(a*d^2*e^(d*x + 2
*c) - I*a*d^2*e^c)) + 1/2*e*(2*(d*x + c)/(a*d) - I*e^(d*x + c)/(a*d) - I*e^(-d*x - c)/(a*d))

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.71 \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {{\left (d^{2} f x^{2} e^{\left (d x + c\right )} + 2 \, d^{2} e x e^{\left (d x + c\right )} - i \, d f x e^{\left (2 \, d x + 2 \, c\right )} - i \, d f x - i \, d e e^{\left (2 \, d x + 2 \, c\right )} - i \, d e + i \, f e^{\left (2 \, d x + 2 \, c\right )} - i \, f\right )} e^{\left (-d x - c\right )}}{2 \, a d^{2}} \]

[In]

integrate((f*x+e)*cosh(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="giac")

[Out]

1/2*(d^2*f*x^2*e^(d*x + c) + 2*d^2*e*x*e^(d*x + c) - I*d*f*x*e^(2*d*x + 2*c) - I*d*f*x - I*d*e*e^(2*d*x + 2*c)
 - I*d*e + I*f*e^(2*d*x + 2*c) - I*f)*e^(-d*x - c)/(a*d^2)

Mupad [B] (verification not implemented)

Time = 1.15 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.55 \[ \int \frac {(e+f x) \cosh ^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {f\,x^2}{2\,a}+{\mathrm {e}}^{c+d\,x}\,\left (\frac {\left (f-d\,e\right )\,1{}\mathrm {i}}{2\,a\,d^2}-\frac {f\,x\,1{}\mathrm {i}}{2\,a\,d}\right )-{\mathrm {e}}^{-c-d\,x}\,\left (\frac {\left (f+d\,e\right )\,1{}\mathrm {i}}{2\,a\,d^2}+\frac {f\,x\,1{}\mathrm {i}}{2\,a\,d}\right )+\frac {e\,x}{a} \]

[In]

int((cosh(c + d*x)^2*(e + f*x))/(a + a*sinh(c + d*x)*1i),x)

[Out]

exp(c + d*x)*(((f - d*e)*1i)/(2*a*d^2) - (f*x*1i)/(2*a*d)) - exp(- c - d*x)*(((f + d*e)*1i)/(2*a*d^2) + (f*x*1
i)/(2*a*d)) + (f*x^2)/(2*a) + (e*x)/a